package com.ch.apigateway;

import com.ch.apigateway.filter.AccessFilter;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

/**
 * @author cj-ch
 * @date 2018/4/13 上午9:13
 */
@SpringCloudApplication
//启用spring cloud网关服务
@EnableZuulProxy
public class ChApiGateApplication {

    @Bean
    public AccessFilter accessFilter(){
        return new AccessFilter();
    }

    public static void main(String[] args) {
        new SpringApplicationBuilder(ChApiGateApplication.class)
                .web(true)
                .run(args);
    }
}
